﻿<UserControl x:Class="Shoozla.FolderListView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:s="clr-namespace:Shoozla"
             xmlns:sv="clr-namespace:Shoozla.ViewModel"
             mc:Ignorable="d" 
             d:DesignHeight="390" d:DesignWidth="677"
             x:Name="FolderViewControl"
             >
    <UserControl.Resources>
        <Style x:Key="ListViewItemContainerStyle" TargetType="{x:Type ListViewItem}">
            <EventSetter Event="MouseDoubleClick" Handler="HandleDoubleClick"/>
            <Setter Property="Background" Value="#ffffff" />
            <Setter Property="HorizontalContentAlignment" Value="Left" />
            <Setter Property="VerticalContentAlignment" Value="Center" />
            <Setter Property="Foreground" Value="Black" />
            <Setter Property="Margin" Value="0,0,0,0" />
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type ListViewItem}">
                        <Border x:Name="Bd" Background="{TemplateBinding Background}" SnapsToDevicePixels="true" BorderThickness="0,0,0,1" BorderBrush="#6FBDE8">
                            <GridViewRowPresenter VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
                        </Border>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsSelected"  Value="true">
                                <Setter TargetName="Bd" Property="BorderBrush" Value="#FF143c65" />
                                <Setter Property="Background" TargetName="Bd">
                                    <Setter.Value>
                                        <LinearGradientBrush EndPoint="0,1" StartPoint="0,0">
                                            <LinearGradientBrush.GradientStops>
                                                <GradientStopCollection>
                                                    <GradientStop Color="#FF75aac7" Offset="0"/>
                                                    <GradientStop Color="#FF143c65" Offset="1"/>
                                                </GradientStopCollection>
                                            </LinearGradientBrush.GradientStops>
                                        </LinearGradientBrush>
                                    </Setter.Value>
                                </Setter>
                            </Trigger>
                            <Trigger Property="IsMouseOver" Value="True">
                                <Setter TargetName="Bd" Property="Background" Value="#e0eff8" />
                            </Trigger>
                            <MultiTrigger>
                                <MultiTrigger.Conditions>
                                    <Condition Property="IsSelected" Value="true" />
                                    <Condition Property="Selector.IsSelectionActive" Value="True" />
                                </MultiTrigger.Conditions>
                                <Setter Property="Background" TargetName="Bd">
                                    <Setter.Value>
                                        <LinearGradientBrush EndPoint="0,1" StartPoint="0,0">
                                            <LinearGradientBrush.GradientStops>
                                                <GradientStopCollection>
                                                    <GradientStop Color="#FF75aac7" Offset="0"/>
                                                    <GradientStop Color="#FF143c65" Offset="1"/>
                                                </GradientStopCollection>
                                            </LinearGradientBrush.GradientStops>
                                        </LinearGradientBrush>
                                    </Setter.Value>
                                </Setter>
                                <Setter Property="BorderBrush" TargetName="Bd" Value="#FF143c65"/>
                                <Setter Property="Foreground" Value="White"/>
                            </MultiTrigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    
    </UserControl.Resources>
    <DockPanel>
        <Grid DockPanel.Dock="Bottom">
            <DockPanel LastChildFill="True" Background="{StaticResource BackgroundBrush}" VerticalAlignment="Center"  Height="55">
                    <WrapPanel DockPanel.Dock="Left">
                    <Button x:Name="OpenFolderBT" Command="{Binding Path=CmdOpenFolder}" Width="50" ToolTip="Open Folder" Style="{DynamicResource CmdButton}" >
                            <Image Source="/Shoozla;component/Images/Folder.ico" />
                        </Button>

                    <Button x:Name="ShowAllBT" Command="{Binding Path=CmdShowAll}" Width="50" ToolTip="Show all Mp3" Style="{DynamicResource CmdButton}" >
                            <Image Source="/Shoozla;component/Images/all.png"/>
                        </Button>
                    <Button x:Name="ShowUnCoveredBT" Command="{Binding Path=CmdShowUnCovered}" Width="50" ToolTip="Show only MP3 without a cover" Style="{DynamicResource CmdButton}" >
                            <Image Source="/Shoozla;component/Images/uncovered.png"/>
                        </Button>
                    <Button x:Name="ShowCoveredBT" Command="{Binding Path=CmdShowCovered}" Width="50" ToolTip="Show only Mp3 with a cover" Style="{DynamicResource CmdButton}" >
                            <Image Source="/Shoozla;component/Images/covered.png"/>
                        </Button>
                    <Button x:Name="SelectAllBT" Command="{Binding Path=CmdSelectAll}" Width="50" ToolTip="Select All" Style="{DynamicResource CmdButton}" >
                            <Image Source="/Shoozla;component/Images/selectAll.png"/>
                        </Button>
                    <Button x:Name="SelectNoneBT" Command="{Binding Path=CmdSelectNone}" Width="50" ToolTip="Clear selection" Style="{DynamicResource CmdButton}" >
                            <Image Source="/Shoozla;component/Images/selectNone.png"/>
                        </Button>
                    </WrapPanel>
                    <WrapPanel DockPanel.Dock="Right">
                    <Button x:Name="SearchBT" Command="{Binding Path=CmdSearch}"  Style="{DynamicResource CmdButton}"  ToolTip="Search covers">
                        <StackPanel  Orientation="Horizontal">
                            <TextBlock VerticalAlignment="Center" Margin="2">Search</TextBlock>
                            <Image Source="/Shoozla;component/Images/search.png" Height="44" Width="57" />
                        </StackPanel>
                    </Button>
                    </WrapPanel>
                <TextBlock></TextBlock>
            </DockPanel>
        </Grid>
        <ListView Name="folderLV" ItemsSource="{Binding Path=CurrentItems}" ItemContainerStyle="{DynamicResource ListViewItemContainerStyle}">
            <ListView.View>
                <GridView>
                    <GridViewColumn Header="" Width="25" CellTemplate="{DynamicResource checkboxCell}" />
                    <GridViewColumn Header="Artist" Width="Auto" CellTemplate="{StaticResource ArtistCell}" />
                    <GridViewColumn Header="Title" Width="Auto"  CellTemplate="{StaticResource TitleCell}"/>
                    <GridViewColumn Header="Album" Width="Auto"  CellTemplate="{StaticResource AlbumCell}"/>
                    <GridViewColumn Header="Genre" Width="Auto"  CellTemplate="{StaticResource GenreCell}"/>
                    <GridViewColumn Header="Cover" Width="Auto"  CellTemplate="{StaticResource hasCoverCell}"/>
                    <GridViewColumn Header="Filename" Width="Auto"  CellTemplate="{StaticResource FileNameCell}"/>

                </GridView>
            </ListView.View>
        </ListView>
    </DockPanel>

</UserControl>
